<template>
  <span class="tag-style">{{ title }}</span>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
      default() {
        return {};
      }
    },
    other: {
      type: String,
      default: ""
    }
  },
  computed: {
    title() {
      if (this.other) {
        return this.item.businessType == 2 ? "车辆委托" : "房源委托";
      } else {
        if (this.item.category == 2 || this.item.vehicleType) {
          return this.item.vehicleType == 1
            ? "到店新车"
            : this.item.vehicleType == 2
            ? "二手车"
            : "车系";
        } else if (this.item.category == 1) {
          return this.item.transaction_type == 1 ||
            this.item.transactionType == 1
            ? "出租房"
            : this.item.new_old == 1 || this.item.newOld == 1
            ? "新房"
            : "二手房";
        } else {
          if (this.item.vehicleType) {
            return this.item.vehicleType == 1
              ? "到店新车"
              : this.item.vehicleType == 2
              ? "二手车"
              : "车系";
          } else if (this.item.transaction_type || this.item.transactionType) {
            return this.item.transaction_type == 1 ||
              this.item.transactionType == 1
              ? "出租房"
              : this.item.new_old == 1 || this.item.newOld == 1
              ? "新房"
              : "二手房";
          } else if (
            this.item.recruitmentType == 1 ||
            this.item.recruitmentType == 2
          ) {
            return this.item.recruitmentType == 1 ? "全职" : "兼职";
          } else {
            return "1";
          }
        }
      }
    }
  },

  created() {
    if (this.other) {
    } else {
    }
    // var item = this.item
    // console.log((item.businessType==1||!item.businessType)?(item.transaction_type ==1||item.transactionType==1)?'出租房':((item.new_old ==1||item.newOld ==1)?'新房':'二手房'):'123');
  }
};
</script>

<style lang="less" scoped>
.tag-style {
  background: #64b6a8;
  color: #fff;
  // font-size: 12px;
  text-align: center;
  // line-height: 1em;
  font-weight: 400;
  margin-right: 5px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.8em;
  vertical-align: unset;
  line-height: 1.6em;
  vertical-align: bottom;
}
</style>
